package com.example.mapinformationandroid.UI;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatSpinner;

import android.os.Bundle;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;

import com.example.mapinformationandroid.R;

import java.util.ArrayList;

public class HTTPTest extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener {
    protected AppCompatSpinner spinner;

    private ArrayList<String> apilist = new ArrayList<String>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_httptest);
        initData();
        initView();
        SpinnerAdapter adapter = new ArrayAdapter<String>(this,R.layout.support_simple_spinner_dropdown_item,apilist);
        spinner.setAdapter(adapter);
        spinner.setOnItemSelectedListener(this);


    }
    protected void initView(){
        spinner = findViewById(R.id.api_spinner);
        findViewById(R.id.button_send).setOnClickListener(this);

    }
    protected void initData(){
        apilist.add("获取资讯列表");
        apilist.add("获取评论列表");
        apilist.add("获取点赞列表");
        apilist.add("获取举报列表");
    }

    @Override
    public void onClick(View v) {

    }

    @Override
    public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {

    }

    @Override
    public void onNothingSelected(AdapterView<?> parent) {

    }
}
